from rest_framework import serializers
from disease.models import DepartmentModel, ScreenModel, CommonDiseasesModel, Disease, DiseaseArticlesModel, DiseaseArticle

# 科室表序列化器
class DepartmentModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = DepartmentModel
        fields = [
            'id', 
            'name'
        ]

# 筛选表序列化器
class ScreenModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = ScreenModel
        fields = [
            'id', 
            'name', 
            'notes',
            'screen_department'
        ]

# 常见疾病表序列化器
class CommonDiseasesModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = CommonDiseasesModel
        fields = [
            'id', 
            'name', 
            'common_diseases_department'
        ]

# 常见疾病详情表序列化器
class DiseaseSerializer(serializers.ModelSerializer):
    class Meta:
        model = Disease
        fields = [
            'id', 
            'name', 
            'code', 
            'description', 
            'common_symptoms', 
            'transmission_routes', 
            'treatment_methods', 
            'prevention_measures', 
            'common_medications', 
        ]

# 疾病表序列化器
class DiseaseArticlesModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseArticlesModel
        fields = [
            'id', 
            'recomment_home', 
            'disease_articles_department', 
            'disease_article'
        ]

# 疾病文章序列化器
class DiseaseArticleSerializer(serializers.ModelSerializer):
    class Meta:
        model = DiseaseArticle
        fields = [
            'id', 
            'title', 
            'code', 
            'description', 
            'common_symptoms', 
            'transmission_routes', 
            'treatment_methods', 
            'prevention_measures', 
            'common_medications', 
            'disease_article'
        ]